package com.example.demo.service;

import com.example.demo.mapper.ArticleMapper;
import com.example.demo.model.Articleinfo;
import org.apache.ibatis.annotations.Param;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import javax.servlet.http.HttpServletRequest;
import java.util.List;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * user:likai
 * Date:2023-02-14
 * Time:10:57
 */
@Service
public class ArticleService {
    @Autowired
    private ArticleMapper articleMapper;
    public List<Articleinfo> getMyList(Integer uid){
        return articleMapper.getMyList(uid);
    }
    public Articleinfo getDetail(Integer aid){
        return articleMapper.getDetail(aid);
    }
    public int update(int id,int uid,String title,String content){
        return articleMapper.update(id,uid,title,content);
    }
    public List<Articleinfo> getList(Integer psize, Integer offset){
        return articleMapper.getList(psize, offset);
    }
    public int total(){
        return articleMapper.getTotalCount();
    }
    public Integer add(String title,String content,Integer uid){
        return articleMapper.add(title,content,uid);
    }
    public Integer selectUid(Integer id){
        return articleMapper.selectUid(id);
    }
    public Integer delete(Integer id){
        return articleMapper.delete(id);
    }
}
